#include "parenthesesmode.h"
#include "ui_parenthesesmode.h"

ParenthesesMode::ParenthesesMode(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::ParenthesesMode)
{
    ui->setupUi(this);

    // 更改描述
    ui->ParenthesesEdit->setPlaceholderText("括号描述");

    ui->InputButton->setText("字符输入");
}

ParenthesesMode::~ParenthesesMode()
{
    delete ui;
}

void ParenthesesMode::on_InputButton_clicked()
{
    if (ui->ParenthesesEdit->text().length() == 0) {
        return;
    }
    Painter *painter = new Painter(BuildBinaryTreeByParentheses(ui->ParenthesesEdit->text()));
    painter->show();
}
